using UnityEngine;
//using UnityEngine.Networking;

public class NetworkTracer : MonoBehaviour
{
	private int userbyteTmp;

	private int totalbyteTmp;

	private float timeTmp;

	private int userbytePerSec;

	private int totalbytePerSec;

	public string Detail;

	public static NetworkTracer instance;

	public bool ShowGUI;

	private void Start()
	{
		instance = this;
	}

	public void Update()
	{
		//if (NetworkTransport.IsStarted)
		//{
		//	int outgoingUserBytesCount = NetworkTransport.GetOutgoingUserBytesCount();
		//	int outgoingFullBytesCount = NetworkTransport.GetOutgoingFullBytesCount();
		//	if (Time.time >= timeTmp + 1f)
		//	{
		//		userbytePerSec = outgoingUserBytesCount - userbyteTmp;
		//		totalbytePerSec = outgoingFullBytesCount - totalbyteTmp;
		//		userbyteTmp = outgoingUserBytesCount;
		//		totalbyteTmp = outgoingFullBytesCount;
		//		timeTmp = Time.time;
		//	}
		//	Detail = "Server Total byte (" + outgoingFullBytesCount + "):" + totalbytePerSec + "byte/sec | User total byte (" + outgoingUserBytesCount + "):" + userbytePerSec + "byte/sec";
		//}
		//else
		//{
		//	Detail = string.Empty;
		//}
	}

	private void OnGUI()
	{
		if (ShowGUI)
		{
			GUILayout.Label(Detail);
		}
	}
}
